home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / wnos / wn941101 / netuser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-10  |  1.5 KB  |  56 lines

  1. #ifndef _NETUSER_H
  2. #define _NETUSER_H
  3.  
  4. /* Global structures and constants needed by an Internet user process */
  5.  
  6. #ifndef _GLOBAL_H
  7. #include "global.h"
  8. #endif
  9.  
  10. #define    NCONN    20        /* Maximum number of open network connections */
  11.  
  12. extern int32 Ip_addr;        /* Our IP address */
  13. extern int Net_error;        /* Error return code */
  14. #define    NONE            0    /* No error */
  15. #define    CON_EXISTS        1    /* Connection already exists */
  16. #define    NO_CONN            2    /* Connection does not exist */
  17. #define    CON_CLOS        3    /* Connection closing */
  18. #define    NO_MEM            4    /* No memory for TCB creation */
  19. #define    WOULDBLK        5    /* Would block */
  20. #define    NOPROTO            6    /* Protocol or mode not supported */
  21. #define    INVALID            7    /* Invalid arguments */
  22.  
  23. #define    INET_EOL    "\r\n"    /* Standard Internet end-of-line sequence */
  24.  
  25. /* Codes for the tcp_open call */
  26. #define    TCP_PASSIVE        0
  27. #define    TCP_ACTIVE        1
  28. #define    TCP_SERVER        2    /* Passive, clone on opening */
  29.  
  30. /* Local IP wildcard address */
  31. #define    INADDR_ANY        0x0L
  32.  
  33. /* Socket structure */
  34. struct socket {
  35.     int32 address;        /* IP address */
  36.     int16 port;            /* port number */
  37. };
  38. #define    NULLSOCK    (struct socket *)0
  39.  
  40. /* Connection structure (two sockets) */
  41. struct connection {
  42.     struct socket local;
  43.     struct socket remote;
  44. };
  45. /* In domain.c: */
  46. int32 resolve __ARGS((char *name));
  47. int32 resolve_mx __ARGS((char *name));
  48. char *resolve_a __ARGS((int32 ip_address, int shorten));
  49.  
  50. /* In netuser.c: */
  51. int32 aton __ARGS((char *s));
  52. char *inet_ntoa __ARGS((int32 a));
  53. char *pinet __ARGS((struct socket *s));
  54.  
  55. #endif    /* _NETUSER_H */
  56.